Has anyone ever been able to prevent the inevitable slow down that occurs when exporting to excel a large number of DOORS objects? |
Re: Export_to_excel script slows down terribly https://www.ibm.com/developerworks/forums/thread.jspa?messageID=14672594� Replacing stuff by global variables might not be enough! In addition exporting large data sets is always prone for filling up the string table pretty badly. But it is really hard to say more, one would need to look into the script. Regards, Mathias Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS |
Re: Export_to_excel script slows down terribly Perhaps start turning off some such features in Excel, and when you find an offender then figure out how to turn that off from your script. -Louie |
Re: Export_to_excel script slows down terribly For example: Instead of processing 100 modules with one execution of a script, process 50 modules with two execution of a script. Or even better with different DOORS sessions. |
Re: Export_to_excel script slows down terribly OurGuest - Wed Dec 21 13:12:39 EST 2011 Hard to believe that this script has been around since the early 2000s and still there is no work-around or fix. Even the author of the script does not have any suggestions for me !! |
Re: Export_to_excel script slows down terribly PatrickGuay - Wed Dec 21 14:21:32 EST 2011 1. Post code. or 2. Post a detailed specification of the function of what is to be done. (The specification shouldn't tell how the original author solved the problem) Perhaps with an unbiased specification someone can provide alternate solutions that can be implemented by your team. |
Re: Export_to_excel script slows down terribly OurGuest - Wed Dec 21 13:12:39 EST 2011
I think running a script with smaller chunks is a questionable way of speeding things up. In our team we have been struggeling a lot with exports of large data sets. The only way I know of to make DOORS slower over time is filling up the allocation list. The below example is a small demonstration of the effect. The script just accesses the Worksheets collection of the excel instance over and over again, without actually doing anything. You will notice from the times on the progressbar it gets slower and slower. Commenting in the oleAutoCloseObject will remove the slowdown. In my experience almost all code for DOORS that you will find especially when it is around for several years ignores the fact, that every property that you read from OLE, that again returns an OLE object will in fact create a new object, that if not properly freed will, slow down your program more and more. You will also find that mistake in native DOORS code. I am pretty sure, that if you post the script you are talking about, that we can find the issue and resolve it.
pragma runLim, 0
OleAutoObj objExcel = oleGetAutoObject "Excel.Application"
print olePut(objExcel, "visible", true)
OleAutoObj objWorksheets = null
int Iterations = 1200
progressStart(dbExplorer, "Slowdown Experiment", "", Iterations )
int i, j
for i in 1:Iterations do {
int startTime = getTickCount_ ()
for j in 1:100 do {
oleGet(objExcel, "Worksheets", objWorksheets)
// oleCloseAutoObject objWorksheets // <<- comment me in
if (progressCancelled) {
if (confirm("Exit loop?")) {
progressStop
halt
}
}
}
progressStep i
int duration = getTickCount_() - startTime
progressMessage "Time for 100 iterations:" duration " ms"
}
progressStop
oleCloseAutoObject objExcel; objExcel = null
Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS
|
Re: Export_to_excel script slows down terribly Mathias Mamsch - Wed Dec 21 17:30:47 EST 2011
I think running a script with smaller chunks is a questionable way of speeding things up. In our team we have been struggeling a lot with exports of large data sets. The only way I know of to make DOORS slower over time is filling up the allocation list. The below example is a small demonstration of the effect. The script just accesses the Worksheets collection of the excel instance over and over again, without actually doing anything. You will notice from the times on the progressbar it gets slower and slower. Commenting in the oleAutoCloseObject will remove the slowdown. In my experience almost all code for DOORS that you will find especially when it is around for several years ignores the fact, that every property that you read from OLE, that again returns an OLE object will in fact create a new object, that if not properly freed will, slow down your program more and more. You will also find that mistake in native DOORS code. I am pretty sure, that if you post the script you are talking about, that we can find the issue and resolve it.
pragma runLim, 0
OleAutoObj objExcel = oleGetAutoObject "Excel.Application"
print olePut(objExcel, "visible", true)
OleAutoObj objWorksheets = null
int Iterations = 1200
progressStart(dbExplorer, "Slowdown Experiment", "", Iterations )
int i, j
for i in 1:Iterations do {
int startTime = getTickCount_ ()
for j in 1:100 do {
oleGet(objExcel, "Worksheets", objWorksheets)
// oleCloseAutoObject objWorksheets // <<- comment me in
if (progressCancelled) {
if (confirm("Exit loop?")) {
progressStop
halt
}
}
}
progressStep i
int duration = getTickCount_() - startTime
progressMessage "Time for 100 iterations:" duration " ms"
}
progressStop
oleCloseAutoObject objExcel; objExcel = null
Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS
Why did you post? |
Re: Export_to_excel script slows down terribly OurGuest - Thu Dec 22 08:05:23 EST 2011 Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS |
Re: Export_to_excel script slows down terribly Attachments attachment_14771697_export_to_excel_NH90.dxl |
Re: Export_to_excel script slows down terribly Mathias Mamsch - Wed Dec 21 17:30:47 EST 2011
I think running a script with smaller chunks is a questionable way of speeding things up. In our team we have been struggeling a lot with exports of large data sets. The only way I know of to make DOORS slower over time is filling up the allocation list. The below example is a small demonstration of the effect. The script just accesses the Worksheets collection of the excel instance over and over again, without actually doing anything. You will notice from the times on the progressbar it gets slower and slower. Commenting in the oleAutoCloseObject will remove the slowdown. In my experience almost all code for DOORS that you will find especially when it is around for several years ignores the fact, that every property that you read from OLE, that again returns an OLE object will in fact create a new object, that if not properly freed will, slow down your program more and more. You will also find that mistake in native DOORS code. I am pretty sure, that if you post the script you are talking about, that we can find the issue and resolve it.
pragma runLim, 0
OleAutoObj objExcel = oleGetAutoObject "Excel.Application"
print olePut(objExcel, "visible", true)
OleAutoObj objWorksheets = null
int Iterations = 1200
progressStart(dbExplorer, "Slowdown Experiment", "", Iterations )
int i, j
for i in 1:Iterations do {
int startTime = getTickCount_ ()
for j in 1:100 do {
oleGet(objExcel, "Worksheets", objWorksheets)
// oleCloseAutoObject objWorksheets // <<- comment me in
if (progressCancelled) {
if (confirm("Exit loop?")) {
progressStop
halt
}
}
}
progressStep i
int duration = getTickCount_() - startTime
progressMessage "Time for 100 iterations:" duration " ms"
}
progressStop
oleCloseAutoObject objExcel; objExcel = null
Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS
I am basically staying in the same worksheet therefore this will not help me much. |
Re: Export_to_excel script slows down terribly PatrickGuay - Thu Dec 22 09:17:51 EST 2011 I have one object in my module -- this function is chewing up time. |
Re: Export_to_excel script slows down terribly OurGuest - Thu Dec 22 10:56:27 EST 2011 Also, I would suggest have some method to disable progress bars -- the way progress bars are implemented in DOORS can slow down the dxl because of use of strings. |
Re: Export_to_excel script slows down terribly OurGuest - Thu Dec 22 12:33:17 EST 2011 |
Re: Export_to_excel script slows down terribly PatrickGuay - Thu Dec 22 09:09:31 EST 2011 Ok ranting being over I found a couple of memory leaks in the code of the exporter:
Having corrected these should greatly improve on the slow down problem. The tricky thing with these leaks is, you will not remove the slowdown until you resolve all of them. Since I did not use static analysis, but a runtime detector I may have only found leaks that were noticable using my test data. I did for example not test pictures, OLEs or tables, so there might still be leaks in the functions processing these, which were not called during my tests. I really do not get the 'createReasonableFilter'. If this is a try to resolve performance/resource issues, this seems like the wrong approach and pretty useless. If this is about exporting only a subset of the module or exporting to multiple pages or something I simply did not get it. Anyway the approach of createReasonableFilter using 'Filters' for determining a split for the module is baaad and slow. Additionally hardcoding the number of objects of the module in the code makes me want to cry. It seems like torture to that nice script. If your problems are not completly resolved, just post back. Additionally you might want to tell something about the export options and the structure of the module you are exporting (number of tables, pictures, OLEs, objects, data size, etc.). Hope that helps, regards, Mathias Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS Attachments attachment_14771922_export_to_excel_NH90_mma.dxl |
Re: Export_to_excel script slows down terribly I used that method initially to create views that would limit the number of objects to a reasonable amount of data that I could work with. Say 1000 objects. Therefore, once the views were created for a module of around 8000 objects (+/- 8 views ) I could simply export the 8 views seperately and then merge the sheets into a single excel sheet. Sorry for the confusion (o:`, |
Re: Export_to_excel script slows down terribly |
Re: Export_to_excel script slows down terribly PatrickGuay - Thu Jan 05 10:13:13 EST 2012 Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS |
Re: Export_to_excel script slows down terribly |